From: Jo-Philipp Wich Date: Fri, 25 Jan 2019 07:19:36 +0000 (+0100) Subject: luci-base: luci.js: add L.bind() helper X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=1b931e0262796b0179ed92a6a893de9ee1049d01;p=project%2Fluci.git luci-base: luci.js: add L.bind() helper Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/htdocs/luci-static/resources/luci.js b/modules/luci-base/htdocs/luci-static/resources/luci.js index 949f730a22..b02710bcb6 100644 --- a/modules/luci-base/htdocs/luci-static/resources/luci.js +++ b/modules/luci-base/htdocs/luci-static/resources/luci.js @@ -488,6 +488,10 @@ throw e; }, + bind: function(fn, self /*, ... */) { + return Function.prototype.bind.apply(fn, this.varargs(arguments, 2, self)); + }, + /* Class require */ require: function(name, from) { var L = this, url = null, from = from || [];